<?php
//Connection statement
require_once('../../../Connections/cn.php');

// begin Recordset
$col__rsCupos = '-1';
if (isset($_GET['id_curso'])) {
  $col__rsCupos = $_GET['id_curso'];
}else{
  $col__rsCupos = 0;
}
$col2__rsCupos = '-1';
if (isset($_GET['a'])) {
  $col2__rsCupos = $_GET['a'];
}else{
  $col2__rsCupos = date('Y');
}
$query_rsCupos = sprintf("SELECT 45 - COUNT(*) AS cupos FROM   matricula WHERE id_curso = %s AND anio_matricula = %s", $col__rsCupos,$col2__rsCupos);
$rsCupos = $cn->SelectLimit($query_rsCupos) or die($cn->ErrorMsg());
$totalRows_rsCupos = $rsCupos->RecordCount();
// end Recordset
?>
<?php //echo $_GET['id_curso']; echo $_GET['a']; ?>
<?php echo number_format($rsCupos->Fields('cupos'),0); ?>
<?php if($rsCupos->Fields('cupos') >= 1 ){ ?>
<img src="imagenes/ui/iconos/CheckConstraint.png" border="0" align="absmiddle">
<?php }else{ ?>
<img src="imagenes/ui/iconos/ObjectNotFound.png" width="16" height="16" border="0" align="absmiddle">
<?php } ?>
<?php echo $_GET['id_curso'];?><?php echo $_GET['a'];?>
<?php
$rsCupos->Close();
?>
